import request from '@/utils/request'

/**
 * @description 获取部门列表
 * @returns
 */
export const getDepartments = () => {
  return request({
    url: '/company/department'
  })
}

/**
 * @description 获取员工简单列表
 * @returns
 */
export function getEmployeeSimpleAPI() {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * @description 添加部门
 * @param {*} data
 * @returns
 */
export function addDepartmentsAPI(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data: data
  })
}
/**
 * @description 根据id 查询部门信息
 * @param {*} id
 * @returns
 */
export function getDepartmentAPI(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'
  })
}

/**
 * @description 根据id编辑部门
 * @param {*} id
 * @returns
 */
export function editDepartmentsAPI(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data: data
  })
}

/**
 * @description 根据部门id，删除部门
 * @param {*} id
 * @returns
 */
export function delDepartmentsAPI(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}
